Repository navigation
test(otel): observe the SDK's default OTLP protocol instead of hardcoding it - #8256
Merged
Merged
Conversation
…ding it The OTLP protocol tests hardcoded each SDK's default protocol per signal, so an SDK migrating its default required disabling, updating and re-enabling the tests. A default_protocol fixture now observes it from an unset control run, and inputs that depend on it are derived at runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
|
vpellan
marked this pull request as ready for review
October 30, 2026 15:06
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
mhlidd
approved these changes
Oct 30, 2026
p-datadog
pushed a commit
that referenced
this pull request
Nov 1, 2026
* u/main: (82 commits) Auto-activate nodejs easy wins for asm-libraries (#8265) Auto-activate nodejs easy wins for apm-sdk-capabilities (#8264) Auto-activate rust easy wins for apm-sdk-capabilities (#8217) Auto-activate golang easy wins for apm-sdk-capabilities (#8263) Auto-activate dotnet easy wins for apm-sdk-capabilities (#8262) test(ffe): cover Go and Java customer exposure hooks (#8094) Move the debugger scenarios to the mocked backend, with remote config sent through it (#8253) test(otel): observe the SDK's default OTLP protocol instead of hardcoding it (#8256) Revert "[debugger] Test that debugger metrics use the debugger telemetry namespace" (#8257) Check the mocked backend network aliases on GitLab (#8212) Agent on the mocked backend: set DD_SITE instead of each intake URL (#8254) [debugger] Test that debugger metrics use the debugger telemetry namespace (#8052) Fail SSI installs when component installation fails (#8246) Collect HotSpot hs_err logs from Java AWS SSI weblogs (#8249) FFE direct shutdown: detect the priming capture without the watchdog latency (#8250) Move DEBUGGER_TELEMETRY to the mocked backend, which serves remote config (#8239) PHP parametric base image (#8172) AI Guard: tests for backend-provided extra_tags on the ai_guard span (#8130) Cbeauchesne/rename dead and legacy features (#8240) Retry AWS SSI jobs when the installer cannot update apt sources (#8245) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The OTLP protocol tests hardcoded each SDK's default protocol per signal in
utils.py. When an SDK migrates its default (.NET is doing so), the tests have to be disabled, updated and re-enabled.Changes
The default is now observed at runtime instead of hardcoded. How the pieces fit:
default_protocol(fixture,otel_env_vars/conftest.py): returns a callable,default_protocol(signal). On first use it starts the SDK throughtest_library_factorywith no protocol variable set and exports once to the HTTP listener (the content type giveshttp/protobuforhttp/json), then falls back to the gRPC listener (grpc). The result is cached per signal and worker. Because it is a callable, it only runs when a test needs the default, so explicit-protocol tests don't depend on it.sdk_default/sdk_non_default(utils.py): functions of(signal, default)used as parametrize values for inputs that depend on the default.sdk_non_defaultpicks a transport the SDK supports that isn't its default; the case-insensitive tests call.upper()on it.resolve_protocol(utils.py): turns a parametrize value into the env value. Functions are called with the observed default; literals pass through.expected_protocol(utils.py): resolvesprotocolandgeneric_protocol, then applies precedence: signal variable, generic variable, then the SDK default (unset, empty or invalid).expected_protocol(fixture, each test file): calls the util with the test's parametrize values.library_envuses it to point the endpoint at the HTTP or gRPC listener, and the test uses it for the content-type assertion, so both always agree.Traces get the same treatment, with
DD_TRACE_OTEL_ENABLED,DD_TRACE_OTEL_SEMANTICS_ENABLEDandOTEL_TRACES_EXPORTER=otlp.test_unset_uses_specification_defaultstill assertshttp/protobuf. Test IDs are unchanged, so no manifest updates.Empty and invalid values are now compared against the SDK's actual default instead of a documented one, so these XPASS:
test_empty/test_invalid(APMAPI-2501): Go useshttp/protobufwhile documentinghttp/json, whichtest_documented_json_defaultstill catches.test_empty_is_treated_as_unset(APMAPI-2531): .NET defaults tohttp/json, whichtest_unset_uses_specification_defaultstill catches.Verified locally on dotnet 3.57.0, and on golang 2.13.0-dev and php 1.24.0 before the final helper refactor.
Workflow
system-tests-reviewers: ask to one of youre co-worker familiar with the tested feature.system-tests-core(slack)🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
🤖 Generated with Claude Code